/************************************************************
   Copyright 2008 Abhinav Pobbati

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*************************************************************/

#pragma once
#include "Havok4Xna/Physics/Dynamics/HkpDynamics.h"
#include "Havok4Xna/Common/Base/HkArray.h"

#pragma unmanaged
#include <Physics/Dynamics/World/hkpWorld.h>
#include <Physics/Dynamics/World/hkpPhysicsSystem.h>
#include <Physics/Dynamics/World/hkpSimulationIsland.h>
#include <Physics/Dynamics/World/Memory/hkpWorldMemoryAvailableWatchDog.h>
#include <Physics/Dynamics/World/Memory/Default/hkpDefaultWorldMemoryWatchDog.h>
#pragma managed

using System::Byte;
using System::UInt32;
using System::Runtime::InteropServices::OutAttribute;
using System::Collections::Generic::IEnumerable;

namespace Havok4Xna {
	ref class HkAabb;
	ref class HkVector4;
	ref class HkStepInfo;

	namespace Physics {
		namespace ConstraintSolver {
			ref class HkpSolverInfo;
		}
		namespace Collide {
			ref class HkpCollisionFilter;
			interface class HkpConvexListFilter;
			ref class HkpCollisionDispatcher;
			ref class HkpWorldRayCastInput;
			ref class HkpWorldRayCastOutput;
			ref class HkpRayHitCollector;
			ref class HkpCollidable;
			ref class HkpCdPointCollector;
			ref class HkpLinearCastInput;
			ref class HkpCollisionInput;
			ref class HkpProcessCollisionInput;
			ref class HkpCdBodyPairCollector;
			interface class HkpShape;
		}
		namespace Internal {
			ref class HkpBroadPhase;
			ref class HkpBroadPhaseHandle;
			ref class HkpLinkedCollidable;
		}
	}
}

using namespace Havok4Xna;
using namespace Havok4Xna::Physics::ConstraintSolver;
using namespace Havok4Xna::Physics::Collide;
using namespace Havok4Xna::Physics::Internal;

namespace Havok4Xna {
	namespace Physics {
		namespace Dynamics {
			ref class HkpPropertyValue;
			ref class HkWorldMemoryAvailableWatchDog;
			ref class HkpWorldObject;
			ref class HkpEntity;
			ref class HkpRigidBody;
			ref class HkpPhantom;
			ref class HkpConstraintInstance;
			ref class HkpRigidBody;
			ref class HkpAction;
			ref class HkpConstraintData;
			ref class HkpWorldCinfo;
			ref class HkpPhysicsSystem;
			ref class HkpActionListener;
			ref class HkpConstraintListener;
			ref class HkpEntityListener;
			interface class HkpPhantomListener;
			interface class HkpIslandActivationListener;
			interface class HkpWorldPostCollideListener;
			interface class HkpWorldPostSimulationListener;
			interface class HkpWorldPostIntegrateListener;
			interface class HkpIslandPostCollideListener;
			interface class HkpIslandPostIntegrateListener;
			interface class HkpCollisionListener;
			interface class HkpWorldDeletionListener;
			ref class HkpContactImpulseLimitBreachedListener;
			ref class HkpContactImpulseLimitBreachedListener;
			ref class HkpBroadPhaseBorder;
			ref class HkpAction;
			ref class HkpSimulationIsland;
			ref class HkpWorld;

			public enum class HkWorldOperationResult : int {
				Postponed = hkWorldOperation::POSTPONED,
				Done = hkWorldOperation::DONE
			};
			public enum class HkpEntityActivation : int {
				DoNotActivate = HK_ENTITY_ACTIVATION_DO_NOT_ACTIVATE,
				DoActivate = HK_ENTITY_ACTIVATION_DO_ACTIVATE
			};
			public enum class HkpStepResult : int {
				Success = HK_STEP_RESULT_SUCCESS,
				MemoryFailureBeforeIntegration = HK_STEP_RESULT_MEMORY_FAILURE_BEFORE_INTEGRATION,
				MemoryFailureDuringCollide = HK_STEP_RESULT_MEMORY_FAILURE_DURING_COLLIDE,
				MemoryFailureDuringToiSolve = HK_STEP_RESULT_MEMORY_FAILURE_DURING_TOI_SOLVE
			};
			public enum class HkpThreadToken : int {
				First = HK_THREAD_TOKEN_FIRST,
				Second = HK_THREAD_TOKEN_SECOND,
				Third = HK_THREAD_TOKEN_THIRD,
				Fourth = HK_THREAD_TOKEN_FORTH,
				Fifth = HK_THREAD_TOKEN_FIFTH,
				Sixth = HK_THREAD_TOKEN_SIXTH
			};
			public enum class HkpUpdateCollectionFilterMode : int {
				IgnoreShapeCollections = HK_UPDATE_COLLECTION_FILTER_IGNORE_SHAPE_COLLECTIONS,
				ProcessShapeCollections = HK_UPDATE_COLLECTION_FILTER_PROCESS_SHAPE_COLLECTIONS
			};
			public enum class HkpUpdateCollisionFilterOnEntityMode : int {
				FullCheck = HK_UPDATE_FILTER_ON_ENTITY_FULL_CHECK,
				DisableEntityEntityCollisionsOnly = HK_UPDATE_FILTER_ON_ENTITY_DISABLE_ENTITY_ENTITY_COLLISIONS_ONLY
			};
			public enum class HkpUpdateCollisionFilterOnWorldMode : int {
				FullCheck = HK_UPDATE_FILTER_ON_WORLD_FULL_CHECK,
				DisableEntityEntityCollisionsOnly = HK_UPDATE_FILTER_ON_WORLD_DISABLE_ENTITY_ENTITY_COLLISIONS_ONLY
			};

			public ref class HkpWorldObject : public INativeReference {
			public:
				enum class BroadPhaseType : int {
					Entity = hkpWorldObject::BROAD_PHASE_ENTITY,
					Phantom = hkpWorldObject::BROAD_PHASE_PHANTOM,
					Border = hkpWorldObject::BROAD_PHASE_BORDER
				};

				void AddProperty(hkUint32 key, HkpPropertyValue ^value);
				HkpPropertyValue ^RemoveProperty(hkUint32 value);
				void EditProperty(hkUint32 key, HkpPropertyValue ^value);
				HkpPropertyValue ^GetProperty(hkUint32 key);
				bool HasProperty(hkUint32 key);
				void LockProperty(hkUint32 key);
				void UnlockPropety(hkUint32 key);
				void UnlockPropertiesFromLoadedObject();
				void ClearAndDeallocateProperties();
				HkWorldOperationResult SetShape(HkpShape ^shape);
				void CopyProperties(HkpWorldObject ^obj);

				DECLARE_COMPLEX_PROPERTY_GET(HkpCollidable, Collidable);
				DECLARE_COMPLEX_PROPERTY_GET(HkpCollidable, CollidableRw);
				DECLARE_COMPLEX_PROPERTY_GET(HkpLinkedCollidable, LinkedCollidable);
				DECLARE_PROPERTY_GET(bool, IsAddedToWorld);
				DECLARE_COMPLEX_PROPERTY_GET(HkpWorld, World);
				DECLARE_PROPERTY_GETSET(hkUlong, UserData);
				DECLARE_PROPERTY_GETSET(String^, Name);

			internal:
				Dictionary<hkUint32, HkpPropertyValue^> ^_properties;
				HK_CLASS_INTERNALS_1(HkpWorldObject, hkpWorldObject)
			};

			public ref class HkpWorld : public INativeReference {
			public:
				enum class ReintegrationRecollideMode : int {
					Reintegrate = hkpWorld::RR_MODE_REINTEGRATE,
					RecollideBroadphase = hkpWorld::RR_MODE_RECOLLIDE_BROADPHASE,
					RecollideNarrowphase = hkpWorld::RR_MODE_RECOLLIDE_NARROWPHASE,
					All = hkpWorld::RR_MODE_ALL
				};

				HkpWorld(HkpWorldCinfo ^info);
				void AddEntity(HkpEntity ^entity);
				void AddEntity(HkpEntity ^entity, HkpEntityActivation initialActivationState);
				bool RemoveEntity(HkpEntity ^entity);
				HkpConstraintInstance ^AddConstraint(HkpConstraintInstance ^constraint);
				bool RemoveConstraint(HkpConstraintInstance ^constraint);
				HkpConstraintInstance ^CreateAndAddConstraintInstance(HkpRigidBody ^bodyA, HkpRigidBody ^bodyB, HkpConstraintData ^constraintData);
				HkpAction ^AddAction(HkpAction ^action);
				void RemoveAction(HkpAction ^action);
				void RemoveActionImmediately(HkpAction ^action);
				HkpPhantom ^AddPhantom(HkpPhantom ^phantom);
				void RemovePhantom(HkpPhantom ^phantom);
				void ActivateRegion(HkAabb ^box);
				void AddPhysicsSystem(HkpPhysicsSystem ^system);
				void RemovePhysicsSystem(HkpPhysicsSystem ^system);
				void UpdateCollisionFilterOnEntity(HkpEntity ^entity, HkpUpdateCollisionFilterOnEntityMode updateMode, HkpUpdateCollectionFilterMode updateShapeCollectionFilter);
				void UpdateCollisionFilterOnPhantom(HkpPhantom ^phantom, HkpUpdateCollectionFilterMode updateShapeCollectionFilter);
				void UpdateCollsionFilterOnWorld(HkpUpdateCollisionFilterOnWorldMode updateMode, HkpUpdateCollectionFilterMode updateShapeCollectionFilter);
				void ReintegrateAndRecollideEntities(IEnumerable<HkpEntity^> ^entityBatch, ReintegrationRecollideMode mode);
				void ReintegrateAndRecollideEntities(IEnumerable<HkpEntity^> ^entityBatch);
				void FindInitialContactPoints(IEnumerable<HkpEntity^>^ entities);
				void FindInitialContactPointsOfAllEntities();
				void CheckDeterminism();
				void Lock();
				void LockReadOnly();
				void Unlock();
				void UnlockReadOnly();
				void MarkForRead();
				void MarkForWrite();
				void UnmarkForRead();
				void UnmarkForWrite();
				void AddActionListener(HkpActionListener ^worldListener);
				void RemoveActionListener(HkpActionListener ^worldListener);
				void AddConstraintListener(HkpConstraintListener ^worldListener);
				void RemoveConstraintListener(HkpConstraintListener ^worldListener);
				void AddEntityListener(HkpEntityListener ^worldListener);
				void RemoveEntityListener(HkpEntityListener ^worldListener);
				void AddPhantomListener(HkpPhantomListener ^worldListener);
				void RemovePhantomListener(HkpPhantomListener ^worldListener);
				void AddIslandActivationListener(HkpIslandActivationListener ^worldListener);
				void RemoveIslandActivationListener(HkpIslandActivationListener ^worldListener);
				void AddWorldPostCollideListener(HkpWorldPostCollideListener ^worldListener);
				void RemoveWorldPostCollideListener(HkpWorldPostCollideListener ^worldListener);
				void AddWorldPostSimulationListener(HkpWorldPostSimulationListener ^worldListener);
				void RemoveWorldPostSimulationListener(HkpWorldPostSimulationListener ^worldListener);
				void AddWorldPostIntegrateListener(HkpWorldPostIntegrateListener ^worldListener);
				void RemoveWorldPostIntegrateListener(HkpWorldPostIntegrateListener ^worldListener);
				void AddIslandPostCollideListener(HkpIslandPostCollideListener ^islandListener);
				void RemoveIslandPostCollideListener(HkpIslandPostCollideListener ^islandListener);
				void AddIslandPostIntegrateListener(HkpIslandPostIntegrateListener ^islandListener);
				void RemoveIslandPostIntegrateListener(HkpIslandPostIntegrateListener ^islandListener);
				void AddCollisionListener(HkpCollisionListener ^worldListener);
				void RemoveCollisionListener(HkpCollisionListener ^worldListener);
				void AddWorldDeletionListener(HkpWorldDeletionListener ^worldListener);
				void RemoveWorldDeletionListener(HkpWorldDeletionListener ^worldListener);
				void AddContactImpulseLimitBreachedListener(HkpContactImpulseLimitBreachedListener ^listener);
				void RemoveContactImpulseLimitBreachedListener(HkpContactImpulseLimitBreachedListener ^listener);
				void SetCollisionFilter(HkpCollisionFilter ^filter, bool runUpdateCollisionFilterOnWorld,
					HkpUpdateCollisionFilterOnWorldMode checkBroadPhaseMode,
					HkpUpdateCollectionFilterMode updateShapeCollectionFilter);
				void CastRay(HkpWorldRayCastInput ^input, HkpWorldRayCastOutput ^output);
				void CastRay(HkpWorldRayCastInput ^input, HkpRayHitCollector ^collector);
				void LinearCast(HkpCollidable ^collA, HkpLinearCastInput ^input, HkpCdPointCollector ^castCollector,
					HkpCdPointCollector ^startCollector);
				void LinearCast(HkpCollidable ^collA, HkpLinearCastInput ^input, HkpCdPointCollector ^castCollector);
				void GetClosestPoints(HkpCollidable ^collA, HkpCollisionInput ^input, HkpCdPointCollector ^collector);
				void GetPenetrations(HkpCollidable ^collA, HkpCollisionInput ^input, HkpCdBodyPairCollector ^collector);
				void ShiftBroadPhase(HkVector4 ^shiftDistance, [Out] HkVector4 ^effectShiftDistanceOut,
					IEnumerable<HkpBroadPhaseHandle^> ^objectsEnteringBroadphaseBorder);
				HkpStepResult StepDeltaTime(float physicsDeltaTime);
				HkpStepResult Integrate(float physicsDeltaTime);
				HkpStepResult Collide();
				HkpStepResult AdvanceTime();
				void ResetThreadTokens();
				void CheckAccessGetActiveSimulationIslands();
				void AttachActionToEntity(HkpAction ^action, HkpEntity ^entity);
				void DetachActionFromEntity(HkpAction ^action, HkpEntity ^entity);

				DECLARE_PROPERTY_GET(int, MemUsageForIntegration)
				DECLARE_PROPERTY_GET(bool, IsLocked)
				DECLARE_PROPERTY_SET(float, FrameTimeMarker)
				DECLARE_PROPERTY_GET(bool, IsSimulationAtMarker)
				DECLARE_PROPERTY_GET(bool, IsSimulationAtPsi)
				DECLARE_PROPERTY_GET(HkpThreadToken, ThreadToken)
				DECLARE_PROPERTY_GET(float, CurrentTime)
				DECLARE_PROPERTY_GET(float, CurrentPsiTime)
				DECLARE_PROPERTY_GETSET(bool, ProcessActionsInSingleThread)
				DECLARE_PROPERTY_GET(HkWorldMemoryAvailableWatchDog^, MemoryWatchDog)
				DECLARE_COMPLEX_PROPERTY_GET(HkpRigidBody, FixedRigidBody)
				DECLARE_COMPLEX_PROPERTY_GET(HkpWorldCinfo, Cinfo)
				DECLARE_COMPLEX_PROPERTY_GET(HkpBroadPhase, BroadPhase)
				DECLARE_COMPLEX_PROPERTY_GET(HkpProcessCollisionInput, CollisionInput)
				DECLARE_COMPLEX_PROPERTY_GET(HkpCollisionDispatcher, CollisionDispatcher)
				DECLARE_COMPLEX_PROPERTY_GET(HkpCollisionFilter, CollisionFilter)
				DECLARE_COMPLEX_PROPERTY_GETSET(HkpBroadPhaseBorder, BroadPhaseBorder)
				DECLARE_COMPLEX_PROPERTY_GET(HkpSimulationIsland, FixedIsland)
				DECLARE_COMPLEX_PROPERTY_GET(HkpPhysicsSystem, WorldAsOneSystem)
				/*DECLARE_PROPERTY_GET(HkArray<HkpPhantom^>^, Phantoms)
				DECLARE_PROPERTY_GETSET(HkArray<HkpSimulationIsland^>^, ActiveSimulationIslands)
				DECLARE_PROPERTY_GETSET(HkArray<HkpSimulationIsland^>^, InactiveSimulationIslands)
				DECLARE_PROPERTY_GET(HkArray<HkpPhysicsSystem^>^, WorldAsSystems)*/

			internal:
				HK_CLASS_INTERNALS(HkpWorld,hkpWorld)
			};

			public ref class HkpPhysicsSystem : public INativeReference {
			public:
				HkpPhysicsSystem();
				void AddRigidBody(HkpRigidBody ^body);
				void AddPhantom(HkpPhantom ^phantom);
				void AddConstraint(HkpConstraintInstance ^constraint);
				void AddAction(HkpAction ^action);
				void RemoveRigidBody(int i);
				void RemovePhantom(int i);
				void RemoveConstraint(int i);
				void RemoveAction(int i);

				/*DECLARE_PROPERTY_GET(HkArray<HkpRigidBody^>, RigidBodies);
				DECLARE_PROPERTY_GET(HkArray<HkpPhantom^>, Phantoms);
				DECLARE_PROPERTY_GET(HkArray<HkpConstraintInstance^>, Constraints);
				DECLARE_PROPERTY_GET(HkArray<HkpAction^>, Actions);*/
				DECLARE_PROPERTY_GETSET(String^, Name);
				DECLARE_PROPERTY_GETSET(hkUlong, UserData);
				DECLARE_PROPERTY_GETSET(bool, Active);
				DECLARE_PROPERTY_GET(bool, HasContacts);

			internal:
				HK_CLASS_INTERNALS(HkpPhysicsSystem, hkpPhysicsSystem)
			};

			public ref class HkpSimulationIsland : public INativeReference {
			public:
				DECLARE_PROPERTY_GET(bool, WasActiveLastFrame);
				DECLARE_PROPERTY_GET(bool, IsFixed);
				DECLARE_PROPERTY_GET(HkpWorld^, World);
				DECLARE_PROPERTY_GET(int, MemUsageForIntegration);
				DECLARE_PROPERTY_GET(int, StorageIndex);
				DECLARE_PROPERTY_GET(int, NumConstraints);

			internal:
				HkpWorld ^world;
				HK_CLASS_INTERNALS_1(HkpSimulationIsland, hkpSimulationIsland)
			};

			public ref class HkpWorldCinfo : public INativeReference {
			public:
				enum class SolverType : int {
					Invalid = hkpWorldCinfo::SOLVER_TYPE_INVALID,
					Type2ItersSoft = hkpWorldCinfo::SOLVER_TYPE_2ITERS_SOFT,
					Type2ItersMedium = hkpWorldCinfo::SOLVER_TYPE_2ITERS_MEDIUM,
					Type2ItersHard = hkpWorldCinfo::SOLVER_TYPE_2ITERS_HARD, 
					Type4ItersSoft = hkpWorldCinfo::SOLVER_TYPE_4ITERS_SOFT, 
					Type4ItersMedium = hkpWorldCinfo::SOLVER_TYPE_4ITERS_MEDIUM, 
					Type4ItersHard = hkpWorldCinfo::SOLVER_TYPE_4ITERS_HARD, 
					Type8ItersSoft = hkpWorldCinfo::SOLVER_TYPE_8ITERS_SOFT, 
					Type8ItersMedium = hkpWorldCinfo::SOLVER_TYPE_8ITERS_MEDIUM,
					Type8ItersHard = hkpWorldCinfo::SOLVER_TYPE_8ITERS_HARD
				};
				enum class SimulationType : int {
					Invalid = hkpWorldCinfo::SIMULATION_TYPE_INVALID,
					Discrete = hkpWorldCinfo::SIMULATION_TYPE_DISCRETE,
					Continuous = hkpWorldCinfo::SIMULATION_TYPE_CONTINUOUS,
					Multithreaded = hkpWorldCinfo::SIMULATION_TYPE_MULTITHREADED
				};
				enum class ContactPointGeneration : int {
					AcceptAlways = hkpWorldCinfo::CONTACT_POINT_ACCEPT_ALWAYS,
					RejectDubious = hkpWorldCinfo::CONTACT_POINT_REJECT_DUBIOUS,
					RejectMany = hkpWorldCinfo::CONTACT_POINT_REJECT_MANY
				};
				enum class BroadPhaseBehavior : int {
					Assert = hkpWorldCinfo::BROADPHASE_BORDER_ASSERT,
					FixEntity = hkpWorldCinfo::BROADPHASE_BORDER_FIX_ENTITY,
					RemoveEntity = hkpWorldCinfo::BROADPHASE_BORDER_REMOVE_ENTITY,
					DoNothing = hkpWorldCinfo::BROADPHASE_BORDER_DO_NOTHING
				};

				HkpWorldCinfo();
				void SetupSolverInfo(SolverType st);
				void SetBroadPhaseWorldSize(float size);

				DECLARE_PROPERTY_GETSET(int, BroadPhaseQuerySize)
				DECLARE_PROPERTY_GETSET(float, ContactRestingVelocity)
				DECLARE_PROPERTY_GETSET(float, CollisionTolerance)
				DECLARE_PROPERTY_GETSET(float, ExpectedMaxLinearVelocity)
				DECLARE_PROPERTY_GETSET(int, SizeOfToiEventQueue)
				DECLARE_PROPERTY_GETSET(float, ExpectedMinPsiDeltaTime)
				DECLARE_PROPERTY_GETSET(int, BroadPhaseNumMarkers)
				DECLARE_PROPERTY_GETSET(float, SolverTau)
				DECLARE_PROPERTY_GETSET(float, SolverDamp)
				DECLARE_PROPERTY_GETSET(int, SolverIterations)
				DECLARE_PROPERTY_GETSET(int, SolverMicrosteps)
				DECLARE_PROPERTY_GETSET(bool, ForceCoherentConstraintOrderingInSolver)
				DECLARE_PROPERTY_GETSET(float, SnapCollisionToConvexEdgeThreshold)
				DECLARE_PROPERTY_GETSET(bool, EnableToiWeldRejection)
				DECLARE_PROPERTY_GETSET(bool, EnabledDeprecatedWelding)
				DECLARE_PROPERTY_GETSET(float, IterativeLinearCastEarlyOutDistance)
				DECLARE_PROPERTY_GETSET(int, IterativeLinearCastMaxIterations)
				DECLARE_PROPERTY_GETSET(float, HighFrequencyDeactivationPeriod)
				DECLARE_PROPERTY_GETSET(float, LowFrequencyDeactivationPeriod)
				DECLARE_PROPERTY_GETSET(Byte, DeactivationNumInactiveFramesSelectFlag0)
				DECLARE_PROPERTY_GETSET(Byte, DeactivationNumInactiveFramesSelectFlag1)
				DECLARE_PROPERTY_GETSET(Byte, DeactivationIntegrateCounter)
				DECLARE_PROPERTY_GETSET(bool, ShouldActivateOnRigidBodyTransformChange)
				DECLARE_PROPERTY_GETSET(float, DeactivationReferenceDistance)
				DECLARE_PROPERTY_GETSET(float, ToiCollisionResponseRotateNormal)
				DECLARE_PROPERTY_GETSET(int, MaxSectorsPerCollideTask)
				DECLARE_PROPERTY_GETSET(bool, ProcessToisMultithreaded)
				DECLARE_PROPERTY_GETSET(int, MaxEntriesPerToiCollideTask)
				DECLARE_PROPERTY_GETSET(bool, EnableDeactivation)
				DECLARE_PROPERTY_GETSET(bool, EnableSimulationIslands)
				DECLARE_PROPERTY_GETSET(UInt32, MinDesiredIslandSize)
				DECLARE_PROPERTY_GETSET(bool, ProcessActionsInSingleThread)
				DECLARE_PROPERTY_GETSET(float, FrameMarkerPsiSnap)

				DECLARE_COMPLEX_PROPERTY_GETSET(HkWorldMemoryAvailableWatchDog, MemoryWatchDog)
				DECLARE_COMPLEX_PROPERTY_GETSET(HkVector4, Gravity)
				DECLARE_COMPLEX_PROPERTY_GETSET(HkAabb, BroadPhaseWorldAabb)
				DECLARE_COMPLEX_PROPERTY_GETSET(HkpCollisionFilter, CollisionFilter)
				DECLARE_COMPLEX_PROPERTY_GETSET(HkpConvexListFilter, ConvexListFilter)

			internal:
				HK_CLASS_INTERNALS(HkpWorldCinfo, hkpWorldCinfo)
			};

			public ref class HkpWorldDynamicsStepInfo : public INativeReference {
			public:
				DECLARE_COMPLEX_PROPERTY_GETSET(HkStepInfo, StepInfo)
				DECLARE_COMPLEX_PROPERTY_GETSET(HkpSolverInfo, SolverInfo)

			internal:
				HK_CLASS_INTERNALS(HkpWorldDynamicsStepInfo, hkpWorldDynamicsStepInfo)
			};

			public ref class HkWorldMemoryAvailableWatchDog : public INativeReference {
			public:
				void WatchMemory(HkpWorld ^world);
				void FreeMemory(HkpWorld ^world);

			internal:
				HK_CLASS_INTERNALS(HkWorldMemoryAvailableWatchDog,hkWorldMemoryAvailableWatchDog)
			};

			public ref class HkpDefaultWorldMemoryWatchDog : public HkWorldMemoryAvailableWatchDog {
			public:
				HkpDefaultWorldMemoryWatchDog();
				HkpDefaultWorldMemoryWatchDog(int minMemoryAvailable);

			internal:
				HK_DERIVED_CLASS_INTERNALS(HkpDefaultWorldMemoryWatchDog, hkpDefaultWorldMemoryWatchDog, HkWorldMemoryAvailableWatchDog)
			};
		}
	}
}
